package job.qi.dftf;

import java.io.IOException;
import java.util.Iterator;

import mapred.base.TextReducer;

import org.apache.hadoop.io.Text;

public class Qi_DFTF_Sum_Reducer extends TextReducer {

    @Override
    public void reduce(Text key, Iterator<Text> values) throws IOException {
        Qi_DFTF_Record sum = new Qi_DFTF_Record();

        while (values.hasNext()) {
            sum.add(new Qi_DFTF_Record(values.next().toString()));
        }

        this.output(key, new Text(sum.toString()));
    }

    @Override
    public void setUp() {
    }

    @Override
    public void tearDown() throws IOException {
    }

}
